<template>
    <div>
        <ul>
            <li v-for="item in navList" @click="getCon(item)">{{item}}</li>
        </ul>
        <div class="con">
            <ul>
                <li v-for="cItem in conList" @click="$router.push({name:'detail',params:{id:cItem.id}})">{{cItem.con}}</li>
            </ul>
        </div>
    </div>
</template>
<script>
export default {
    created(){
        this.$http.get('/api/newsNav').then((res) => {
            if(res.data.code === 1){
                this.navList = res.data.data;
                return this.$http.get('/api/data',{params:{type:this.navList[0]}})
            }
        }).then((con) => {
            if(con.data.code === 1){
                this.conList = con.data.data;
                console.log(this.conList)
            }
        }).catch((error) => {
            console.warn(error)
        })
    },
    data(){
        return {
            navList:[],
            conList:[]
        }
    },
    methods:{
        getCon(){

        }
    }
}
</script>